package com.wanmait.community.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.wanmait.community.mapper.AccessRecordMapper;
import com.wanmait.community.entity.AccessRecord;
import com.wanmait.community.service.AccessRecordService;

import javax.annotation.Resource;

@Service
public class AccessRecordServiceImpl extends ServiceImpl<AccessRecordMapper, AccessRecord> implements AccessRecordService{
@Resource
private AccessRecordMapper accessRecordMapper;

    @Override
    public PageInfo<AccessRecord> findByPage(AccessRecord accessRecord, int pageNum, int pageSize) {
        PageHelper.startPage(pageNum, pageSize);
        List<AccessRecord> list = accessRecordMapper.handleselect(accessRecord);
        PageInfo<AccessRecord> pageInfo = new PageInfo<>(list,3);
        return pageInfo;
    }



    @Override
    public void delete(Integer id) {
        accessRecordMapper.delete(id);
    }

    @Override
    public void handleinsert(AccessRecord accessRecord) {
        accessRecordMapper.handleinsert(accessRecord);
    }
}
